package mgt.pages

class SpecialUserCreatePage extends geb.Page {
    static url = "/specialUser/create"

    static content = {
        rateLimitStrategySelect(wait: true) { $("#strategy") }

        clientIdField(wait: true) { $("#clientId") }
        thresholdField(wait: true) { $("#threshold") }

        createButton(to: SpecialUserShowPage) { $(".save") }
    }

    SpecialUserShowPage createSpecialUser(Long rateLimitStrategyId, String clientId, Long threshold) {
        rateLimitStrategySelect.value(rateLimitStrategyId)

        clientIdField.value(clientId)
        thresholdField.value(threshold)

        createButton.click()

        return browser.page
    }
}